/*
 * Copyright 2009-2010 Nanjing RedOrange ltd (http://www.red-orange.cn)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package redora.api.fetch;

/**
 * The Pagination Mode determines how your query is split up in partial queries.
 * Normally you just want to run the entire query. In that case you need
 * Mode.All.<br>
 * Then there is the classical pagination. This Mode. Page determines the total
 * number of records and then it will produce something you could show like:<br>
 * first previous 1 2 3 4 ... 99 100 101 next last<br>
 * Finally there is Mode.Scroll. Use this if you need to work through all the
 * records but you don't (want) to know how many records there eventually will
 * be retrieved. The Scroll mode therefore can only provide a next() operation.
 * In a AJAX enabled client you can use Scroll to automatically fetch new
 * records as soon as the user has scrolled far enough down the table. <br>
 * If you expect large results from a query you should use the Scroll or Page
 * mode. The Page mode is most scalable, in the event all the records are
 * retrieved, the Page mode Set will always have maximal pageSize records.
 */
public enum Mode {
    /** Retrieves all records. */
    All,
    /**
     * Retrieves classic paginated style records, it also retrieves total
     * retrievable # of records.
     */
    Page,
    /** Retrieves records in a scrollable style. */
    Scroll
}
